<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%--
  Created by IntelliJ IDEA.
  User: E550
  Date: 2017/8/18
  Time: 18:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <c:import url="/WEB-INF/jsp/frontend/head.jsp"/>
    <c:import url="/WEB-INF/jsp/frontend/script.jsp"/>
    <c:import url="/WEB-INF/jsp/frontend/community/head.jsp"/>
    <c:import url="/WEB-INF/jsp/frontend/community/script.jsp"/>
    <link rel="stylesheet" href="<spring:url value="/css/aos.css"/>" />
    <title>Community</title>
    <script>

        function send(block, type) {
            var Url = "<spring:url value="/community/type" />";
            $.ajax({
                type: "POST",
                cache: false,
                async: false,
                url: Url,
                data: {"block":block,"type": type},
                dataType: "html",
                success: function (data) {
                    if(block == 'post') {
                        $("#post_block_list").html(data);
                    }
                    if(block == 'blog') {
                        $("#blog_block_list").html(data);
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("修改失败");
                    alert(XMLHttpRequest.status);
                    alert(XMLHttpRequest.readyState);
                    alert(textStatus);
                }
            });

        }


    </script>
</head>
<body id="body">
<div class="head">

    <c:import url="/WEB-INF/jsp/frontend/header.jsp"/>
</div>


<div class="row" id="container">

    <div class="col-md-6 col-md-3" id="user">
        <div class="user-container" >
            <div id="user-info">
                <%--<div id="head_pic"></div>--%>
                <img class="community-avatar img-circle" src="<spring:url value="${userInfo.userPhoto}"/>">
                <div id="intro">
                    <%--<div id="user_name">{{用户名}}</div>--%>
                    <%--<div id="grade">活跃值：<span style="">{{666}}</span></div>--%>
                    <div id="user_name">${userInfo.userName}</div>
                    <div id="grade">活跃值：<span style="">${userInfo.userContribution}</span></div>
                </div>
            </div>
            <div style="margin: 40px 0; font-size: 16px;">活跃度排名</div>
            <div id="grade-rank">
                <jsp:include page="/WEB-INF/jsp/frontend/community/blockList/userContributionList.jsp" flush="true"/>
            </div>
        </div>
        <div class="alt-container" >
            <img src="<spring:url value="/images/contact.png"/>">
        </div>
    </div>


    <div class="col-md-12 col-md-6" id="topics">
        <div id="exchange" class="topic" aos="flip-left">
            <div class="topic-area">
                <span class="theme-area">主题交流区</span>
                <ul class="topic-menus">
                    <li><a href="javascript:void(0)" onclick="send('post', 'essence')">精华帖</a></li>
                    <img src="<spring:url value="/images/line_short.png"/>" class="line_short1">
                    <li><a href="javascript:void(0)" onclick="send('post', 'hot')">今日热门</a></li>
                    <img src="<spring:url value="/images/line_short.png"/>" class="line_short1">
                    <li><a href="javascript:void(0)">最新回复</a></li>
                    <img src="<spring:url value="/images/line_short.png"/>" class="line_short1">
                    <li><a href="javascript:void(0)" onclick="send('post', 'new')">最新主题</a></li>

                </ul>
            </div>
            <div class="exchange-lists">
                <div id="post_block_list">
                    <jsp:include page="/WEB-INF/jsp/frontend/community/blockList/postBlockList.jsp" flush="true"/>
                </div>
                <a href="<spring:url value="/postList"/> ">
                    <div class="see-all">查看全部</div>
                </a>
            </div>

        </div>
        <div id="publish" class="topic" aos="flip-left">
            <div class="topic-area">
                <span class="theme-area">文章发布区</span>
                <ul class="topic-menus">
                    <li><a href="javascript:void(0)" onclick="send('blog', 'essence')">精华帖</a></li>
                    <img src="<spring:url value="/images/line_short.png"/>" class="line_short1">
                    <li><a href="javascript:void(0)" onclick="send('blog', 'hot')">今日热门</a></li>
                    <img src="<spring:url value="/images/line_short.png"/>" class="line_short1">
                    <li><a href="javascript:void(0)">最新回复</a></li>
                    <img src="<spring:url value="/images/line_short.png"/>" class="line_short1">
                    <li><a href="javascript:void(0)" onclick="send('blog', 'new')">最新主题</a></li>

                </ul>
            </div>
            <div class="exchange-lists">
                <div id="blog_block_list">
                    <jsp:include page="/WEB-INF/jsp/frontend/community/blockList/blogBlockList.jsp" flush="true"/>
                </div>
                <a href="<spring:url value="/blogList"/> ">
                    <div class="see-all">查看全部</div>
                </a>
            </div>
        </div>
    </div>


    <div class="col-md-6 col-md-3" id="activity">
        <div class="main-page-activity-container" aos="fade-left">
            <div class="activity-list-title" style="font-size: 18px; margin-bottom: 10px; margin-left: 10px;">活动列表</div>
            <a href="<spring:url value="/activityList" />">
                <div class="see-all activity-see-all">查看全部</div>
            </a>
            <div class="activity-list">
                <div id="activity_block_list">
                    <jsp:include page="/WEB-INF/jsp/frontend/community/blockList/activityBlockList.jsp" flush="true"/>
                </div>
            </div>
        </div>
    </div>

</div>

<script src="<spring:url value="/js/aos.js"/>"></script>
<script>
    AOS.init({
        easing: 'ease-out-back',
        duration: 1000
    });
</script>

<c:import url="/WEB-INF/jsp/frontend/footer.jsp"/>
<script type="text/javascript">
    window.onload = function() {
        //配置
        var config1 = {
            vx: 2,  //小球x轴速度,正为右，负为左
            vy: 2,  //小球y轴速度
            height: 2,  //小球高宽，其实为正方形，所以不宜太大
            width: 2,
            count: 100,      //点个数
            color: "188,188,188",  //点颜色
            stroke: "188,187,187",      //线条颜色
            dist: 8000,    //点吸附距离
            e_dist: 20000,   //鼠标吸附加速距离
            border_radius: 20,
            max_conn: 1   //点到点最大连接数
        };

        var body1 = document.getElementById("body");

        CanvasParticle(config1,body1);

    }
</script>
</body>

</html>
